package eiisan.datatime;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Locale;

public class TimeFormateTest {
    public static void main(String[] args) {
        DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("MMM d, yyyy h:mm:ss a").withLocale(Locale.US);

        LocalDateTime dateTime = LocalDateTime.parse("Aug 7, 2021 12:30:19 PM", dateTimeFormatter);

        System.out.println(dateTime);

        DateTimeFormatter df= DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

        String temp = df.format(dateTime);

        System.out.println(temp);
    }
}
